package com.yehangtech.designpattern.行为型_责任链模式.service;


import com.yehangtech.designpattern.行为型_责任链模式.entity.AuthInfo;

import java.text.SimpleDateFormat;
import java.util.Date;

public abstract class AbstractAuthLink {
    protected SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 时间格式化
    protected String levelUserId; // 级别⼈员ID
    protected String levelUserName; // 级别⼈员姓名
    private AbstractAuthLink next; // 责任链

    public AbstractAuthLink(String levelUserId, String levelUserName) {
        this.levelUserId = levelUserId;
        this.levelUserName = levelUserName;
    }

    public AbstractAuthLink next() {
        return next;
    }

    public AbstractAuthLink appendNext(AbstractAuthLink next) {
        this.next = next;
        return this;
    }

    public abstract AuthInfo doAuth(String uId, String orderId, Date authDate);
}
